#pragma once
#include "Iphlpapi.h"
extern "C" class _declspec(dllexport) CAdapterCtrl
{
public:
	CAdapterCtrl(void);
	~CAdapterCtrl(void);
	CString GetMACAddr();
private:
	PIP_ADAPTER_ADDRESSES m_pAddresses;
	int m_nAmount;
	PIP_ADAPTER_ADDRESSES m_pCurrAddresses;
	PIP_ADAPTER_INFO m_pAdapter;
public:
	void Init(void);
	int SetCurAdapIndex(int nIndex);


	CString GetAdapterName(void);
	CString GetIPAddr(void);
	CString GetMaskAddr(void);
	CString GetGateWay(void);
	CString GetDNSAddrs(void);
	int GetAdapNum(void);
	CString GetPCName(void);

	int SetDNS(CString szDNSAddr);
	int m_nIndex;
	bool NotifyIPChange(CString lpszAdapterName, int nIndex, CString pIPAddress, CString pNetMask);
	bool RegSetAdapter(CString lpszAdapterName, CString pIPAddress, CString pNetMask, CString pNetGate);
	void Release(void);
};

